﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class BackGround : MonoBehaviour
{
    SpriteRenderer sr;
    private void Awake()
    {
        sr = GetComponent<SpriteRenderer>();
        int pwidth = sr.sprite.texture.width;
        int pheight = sr.sprite.texture.height;
        print("w:"+pwidth+"h:"+pheight);
        int sw = Screen.width;
        int sh = Screen.height;
        print("w:" + sw + "h:" + sh);
        float x = sw / (float)pwidth;
        float y = sh / (float)pheight;
        transform.localScale = new Vector3(x, y, 1);
    }
}
